package com.lxxin.controller;

import com.fasterxml.jackson.databind.util.JSONPObject;
import com.lxxin.pojo.Link;
import com.lxxin.pojo.Result;
import com.lxxin.utils.HttpRequestUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/bangumi")
public class BangumiController {

    @GetMapping("/calendar")
    @ApiOperation("每日放送")
    public String calendar() {
        String url = "https://api.bgm.tv/calendar";
        String calendar = HttpRequestUtil.sendGet(url);
        return calendar;
    }

    @GetMapping("/watching")
    @ApiOperation("追番列表")
    public String watching() {
        String url = "https://api.bgm.tv/user/lxxin/collection?cat=watching&responseGroup=medium";
        String watching = HttpRequestUtil.sendGet(url);
        return watching;
    }

}
